﻿using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
namespace INTEX.DataBase.Tools
{
    public partial class INTEXDBC
    {
        public DataSet QueryLIEFKO(DataRow dwData, int option = 1)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1 = OracleDB.CreateCommand();
            // APZMANDANT  APZART APZVAR APZANRKRS APZALFDNR APZSTUFE
            switch (option)
            {
                case 1:
                    break;
                case 2:
                    break;
                case 3:
                    break;
                case 4:
                    break;
                case 5:
                    or1.CommandText = "SELECT DISTINCT LF.* FROM EKKOPF FL JOIN LIEFKO LF"
             + " ON FL.EKKMANDANT=LSKMANDANT AND FL.EKKLIEFNR=LSKLIEFNR"
             + " WHERE EKKMANDANT=:EKKMANDANT AND EKKAUFKRS=:EKKAUFKRS AND EKKAUFLFD=:EKKAUFLFD";
                    or1.Parameters.Add("EKKMANDANT", OracleType.NVarChar).Value = dwData["EKKMANDANT"].ToString();
                    or1.Parameters.Add("EKKAUFKRS", OracleType.NVarChar).Value = dwData["EKKAUFKRS"].ToString();
                    or1.Parameters.Add("EKKAUFLFD", OracleType.NVarChar).Value = dwData["EKKAUFLFD"].ToString();
                    break;
                default:

                    break;
            }

            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "LIEFKO";
            }
            setReturn.Merge(Result);
            return setReturn;
        }
    }
}
